function openWin(sURL, sWindowName, w, h, sScroll, reSize, status) 
{
	// 화면 중앙으로 Popup 띄우기.. 스크롤바는 옵션..
	// ex)
	//		openWin("test.asp", "winTest", 400, 300); 			// 스크롤바 없음
	//		openWin("test.asp", "winTest", 400, 300, "yes"); 	// 스크롤바 없음
	//		openWin("test.asp", "winTest", 400, 300, "auto"); 	// 스크롤바 없음
	
	var x = (screen.width - w) / 2;
	var y = (screen.height - h) / 2;
	
	if (sScroll==null) sScroll = "no";
	if (screen.width == 800 && screen.height== 600 ) sScroll = "yes"; // 해상도 800*600일 때 스크롤 생기도록 함 
	
	var sOption = "";
	sOption = sOption + "toolbar=no, channelmode=no, location=no, directories=no, menubar=no";
	sOption = sOption + ", scrollbars=" + sScroll + ", resizable=" + reSize + ", status=" + status +", left=" + x + ", top=" + y + ", width=" + w + ", height=" + h;

	var win = controlOpenWindow(sURL, sWindowName, sOption);
	return win;
}

// 빠르게 띄우기 팝업/////////////////////////////////////////
// 사용예 var win = controlOpenWindow("notice","/notice.jsp","...");
var arrWndOpenWindow = new Array();

function push(array, arg){
	array[array.length] = arg;
}

function pop(array){
	var obj = array[0];
	var temp = new Array();
	for (var i = 1; i < array.length; i++){
		temp[i-1] = array[i];
	}
	array = temp;
	return obj;
}

function controlOpenWindow(strURL, strWndName, strOptions) 
{
	var arrTemp = new Array();
	var wndTemp;
	var wndName;
	
	var arrWndOpenWindow = getArrWndOpenWindow();
	if ( arrWndOpenWindow == null) {
		arrWndOpenWindow = this.arrWndOpenWindow;
	}
	
	for (var i = 0; i < arrWndOpenWindow.length; i++ ) {
		wndTemp = arrWndOpenWindow[i];
		if ( wndTemp == null) {
			continue;
		}
		if ( !wndTemp['window'] ) {
			continue;
		}
		if ( wndTemp['window'].closed ) {
			arrWndOpenWindow[i] = null;
			continue;
		}
		wndName = wndTemp['name'];
		if ( wndName != "" && strWndName == wndName ) {
			wndTemp['window'].location.replace(strURL);

			push(arrTemp, wndTemp);
			for (var j = 0; j < arrTemp.length; j++ ) {
				push(arrWndOpenWindow, arrTemp[j]);
			}
			return null;
		}
		push(arrTemp, wndTemp);
	}
	for (var i = 0 ; i < arrTemp.length; i++ ) {
		push(arrWndOpenWindow, arrTemp[i]);
	}

	var	wndNewWindow = window.open(strURL, '', strOptions);
	
	var wndSaveWindow = new Array();
	wndSaveWindow['name'] = strWndName;
	wndSaveWindow['window'] = wndNewWindow;

	push(arrWndOpenWindow, wndSaveWindow);
	return wndNewWindow;
}

function getArrWndOpenWindow() {
	return top.arrWndOpenWindow;
}
//빠르게 띄우는 팝업관련 끝//////////////////////////////////


// Flash 파일 호출 //////////////////////////
function getFlash( swf, data, name, width, height ){
	if( name == undefined )		name = "flash1";
	if( width == undefined )	width = "100%";
	if( height == undefined )	height = "100%";
	
	var returnStr = "";
	returnStr += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' ";
	returnStr += "        id='" + name + "' width='" + width + "' height='" + height + "' ";
	returnStr += "        codebase='http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab'> ";
	//returnStr += "	  <param name='wmode' value='opaque' />";
	returnStr += "    <param name='movie' value='" + swf + "' />";
	returnStr += "    <param name='quality' value='high' /> ";
	returnStr += "    <param name='allowScriptAccess' value='sameDomain' /> ";
	returnStr += "    <param name='flashvars' value=\"" + data + "\" /> ";
	returnStr += "    <embed src='" + swf + "' quality='high' bgcolor='#869ca7' ";
	returnStr += "           width='" + width + "' height='" + height + "' name='" + name + "' align='middle' ";
	returnStr += "           play='true' ";
	returnStr += "           loop='false' ";
	returnStr += "           quality='high' ";
	returnStr += "           allowScriptAccess='sameDomain' ";
	returnStr += "           type='application/x-shockwave-flash' ";
	returnStr += "           pluginspage='http://www.adobe.com/go/getflashplayer' ";
	returnStr += "           flashvars=\"" + data + "\">";
	returnStr += "    </embed> ";
	returnStr += "</object> ";
	
	document.write ( returnStr );
}
// Flash 파일 호출 끝 ////////////////////////

// FGrid 와 관련된 함수들 .. 시작 /////////////
function convertXml2Array(xml, keys) 
{
 	var arr = new Array();
 	if( !xml.startWith("<DATA>") ) {
 		alert("데이타 포멧이 잘못되었습니다.");
 		return;
 	}

 	var trArr = xml.substring("<DATA>".length).split("<TR>");
 	for( var i = 1; i < trArr.length; i++ ) {
 		var eIdx = trArr[i].lastIndexOf("</TR>");
 		trArr[i] = trArr[i].substring(0, eIdx);
 		
 		var obj = convertXml2Object(trArr[i], keys);
 		
 		arr.push(obj);
 	}
 	
 	return arr;
}

function convertXml2JSON(xml, keys) 
{
 	var jsonStr;
 	
 	if( !xml.startWith("<DATA>") ) {
 		alert("데이타 포멧이 잘못되었습니다.");
 		return;
 	}
 	
 	var trArr = xml.substring("<DATA>".length).split("<TR>");
 	jsonStr = "[ " ;
 	for( var i = 1; i < trArr.length; i++ ) {
 		var eIdx = trArr[i].lastIndexOf("</TR>");
 		trArr[i] = trArr[i].substring(0, eIdx);
 		
 		var obj = convertXml2Object(trArr[i], keys);
 		
 		if( i < trArr.length-1 ) {
 			obj += ", ";
 		}
 			
 		jsonStr += obj;
 	}
 	
 	return jsonStr + "]";
}

function convertXml2Object(str, keys) 
{
	if( str.length < 1 ) return;
	
	var obj = "{";
	var keyArr = toArray(keys, "|");
	
	for( var i = 0; i < keyArr.length; i++ ) {
		if( str.indexOf("<" + keyArr[i] + "/>") > -1 )
			obj = obj + "\"" + keyArr[i] + "\": \"\"" ;
		else {
			var sIdx = str.indexOf("<" + keyArr[i] + ">");
			sIdx += ("<" + keyArr[i] + ">").length
			var eIdx = str.lastIndexOf("</" + keyArr[i] + ">");
			
			var val = str.substring(sIdx, eIdx);
			val = val.replace(/\"/g, "'");
			obj = obj + "\"" + keyArr[i] + "\": \"" + val + "\"";
		}
		
		if( i < keyArr.length - 1 ) 
			obj += ", ";
	}
	
	return obj + "}";
}
// FGrid 와 관련된 함수들 .. 끝 ///////////////